//index.js
//获取应用实例
var app = getApp()
Page({
  data: {
    motto: 'Hello World',
    userInfo: {},
    grids: [
      { title: '我的小店', url: '../shop/home/index/index', icon: '' },
      { title: '我的商家', url: '../home/index', icon: '' },
      { title: '我的客户', url: '../home/index', icon: '' },
      { title: '我的订单', url: '../home/index', icon: '' },
      { title: '其它1', url: '', icon: '' },
      { title: '其它2', url: '', icon: '' },
      { title: '其它3', url: '', icon: '' },
      { title: '其它4', url: '', icon: '' },
      { title: '其它5', url: '', icon: '' }
    ]

  },
  //事件处理函数
  bindViewTap: function () {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  bindGoHomeTap: function () {
    wx.navigateTo({
      url: '../home/index',
    })
  },

  bindBuyerTap: function () {
    wx.navigateTo({
      url: '../home/index',
    })
  },

  bindSellerTap: function () {
    wx.navigateTo({
      url: '../shop/home/index/index',
    })
  },
  onLoad: function () {
    console.log('onLoad')
    var that = this
    //调用应用实例的方法获取全局数据
    app.getUserInfo(function (userInfo) {
      //更新数据
      that.setData({
        userInfo: userInfo
      })
    })
  }
})
